package com.cskaoyan.mapper;

import com.cskaoyan.model.*;
import com.cskaoyan.model.vo.BrandBeanVO;
import com.cskaoyan.model.vo.CategoryBeanVO;
import com.cskaoyan.model.vo.StorageVO;
import com.cskaoyan.model.Goods;
import com.cskaoyan.model.GoodsExample;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface GoodsMapper {
    List<Goods> select(@Param("name") String name, @Param("goodsId") Integer goodsId, @Param("sort") String sort, @Param("order") String order, @Param("goodsSn") String goodsSn);

    long countByExample(GoodsExample example);

    int deleteByExample(GoodsExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(Goods record);

    int insertSelective(Goods record);

    List<Goods> selectByExampleWithBLOBs(GoodsExample example);

    List<Goods> selectByExample(GoodsExample example);

    Goods selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") Goods record, @Param("example") GoodsExample example);

    int updateByExampleWithBLOBs(@Param("record") Goods record, @Param("example") GoodsExample example);

    int updateByExample(@Param("record") Goods record, @Param("example") GoodsExample example);

    int updateByPrimaryKeySelective(Goods record);

    int updateByPrimaryKeyWithBLOBs(Goods record);

    int updateByPrimaryKey(Goods record);

    void deleteGoodsById(Integer id);

    List<BrandBeanVO> queryBrand();

    List<CategoryBeanVO> queryFatherCategory();

    List<CategoryBeanVO> queryChildrenCategory(Integer id);

    void insertOneFile(@Param("file") StorageVO fileInfo);

    List<Comment> queryComment(@Param("sort") String sort, @Param("order") String order, @Param("userId") Integer userId);

    void deleteCommentById(Integer id);

    void createGoodsByGoods(Goods goods);

    Integer selectCategoryId1(Integer id);

    Integer selectCategoryId2(Integer id);

    List<GoodsAttribute> selectAttributeById(Integer id);

    List<GoodsSpecification> selectSpecificationById(Integer id);

    List<GoodsProduct> selectProductById(Integer id);

    void setRetailPrice(@Param("goodId") Integer goodId, @Param("price") Double price);

    Integer selectGoodsIdByName(String name);
}
